﻿<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title>为图片添加边框</title>
<script type="text/javascript" src="./js/jquery-1.8.3.min.js"></script>
<script type="text/javascript">
$(function(){
 $("img").click(function(){
 // $("img").css("border","1px solid red");
  $("img").addClass("border");
 });
});
</script>
<style type="text/css">
    .border{border:1px solid #ccc;}
</style>
</head>
<body> 
    <img src="./images/pic.gif" />  
</body>
</html>
